package com.evil.plugin.es;

import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.ScriptPlugin;
import org.elasticsearch.script.ScriptContext;
import org.elasticsearch.script.ScriptEngine;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Collection;

/**
 * @author liyang
 * @date 2024-08-12 09:59
 */
public class RemotePlugin extends Plugin implements ScriptPlugin {
    private static final Logger logger = LoggerFactory.getLogger(RemotePlugin.class);

    @Override
    public ScriptEngine getScriptEngine(Settings settings, Collection<ScriptContext<?>> contexts) {
        logger.info("RemotePlugin|getScriptEngine|settings:{}, contexts:{}", settings, contexts);
        return new RemoteScriptEngine();
    }
}
